import Axios from '@/utils/request'
import {getResult} from '@/api/util'
import website from '@/const/website.js'

const SHARE = `https://debug.yasee.com.cn/`

/**
 * 获取首页接口
 * @author 李代弟
 * @Date 2023-09-20 17：00
 */
export function selectTopContentApi(data) {
    return Axios({
        url: `/cms/yaseeContent/selectTopContent`,
        method: 'get',

    })
}

//增加视频播放量
export function addVisit(data) {
    return Axios({
        url: '/cms/yaseeContent/addVisit',
        method: 'post',
        data: data,

    })
}

export function reportList(data) {
    return Axios({
        url: '/admin/dict/type/report_type',
        method: 'get',
    })
}

export function channelList(data) {
    return Axios({
        url: `/cms/yaseeContentRouterDetail/channelList/${data.subscribe}`,
        method: 'get',
    })
}

export function contentSearch(data) {
    return Axios({
        url: '/cms/yaseeContentSearch/contentSearch',
        method: 'get',
        params: data,
    })
}

export function publish(data) {
    return Axios({
        url: '/cms/yaseeContent/addContent',
        method: 'post',
        data: data,
    })
}

export function publishChoose(data) {
    return Axios({
        url: '/cms/yaseeContentRouter/all',
        method: 'get',
        params: data,
    })
}

//============================================公共接口================================================
//点赞
export function updateLikes(data) {
    return Axios({
        url: '/cms/yaseeLikeDeitail/updateLikes',
        method: 'get',
        params: data,
    })
}

//收藏
export function addCollect(data) {
    return Axios({
        url: `/cms/yaseeContentCollect/addCollect/${data.id}`,
        method: 'get',

    })
}

//关注
export function addAuthorLike(data) {
    return Axios({
        url: `/cms/yaseeAuthorLikeDetail/addAuthorLike/${data.id}`,
        method: 'get',

    })
}

//新增评论
export function addComment(data) {
    return Axios({
        url: '/cms/yaseeContentComment/addComment',
        method: 'post',
        data: data,

    })
}

//删除评论
export function deleteComment(id) {
    return Axios({
        url: `/cms/yaseeContentComment/deleteComment/${id}`,
        method: 'delete',
    })
}

//查询评论列表
export function commentList(data) {
    return Axios({
        url: `/cms/yaseeContentComment/commentList`,
        method: 'get',
        params: data,

    })
}

//举报评论
export function report(data) {
    return Axios({
        url: '/cms/yaseeContentReportDetail/report',
        method: 'post',
        data: data,

    })
}

//===========================================短视频页面================================================
export function queryVideoList(data) {
    return Axios({
        url: '/cms/yaseeContent/queryVideoPage',
        method: 'get',
        params: data,

    })
}

//============================================订阅页面==================================================
export function channelListApi(data) {//已订阅/暂未订阅列表
    return Axios({
        url: '/cms/yaseeContentRouterDetail/channelList/' + data.typeId,
        method: 'get',

    })
}

export function updateChannelApi(obj) {//订阅拖拽排序
    return Axios({
        url: '/cms/yaseeContentRouterDetail/updateChannel',
        method: 'put',
        data: obj,

    })
}

export function deleteChannelApi(data) {//删除订阅
    return Axios({
        url: '/cms/yaseeContentRouterDetail/deleteChannel/' + data.id,
        method: 'get',

    })
}

export function addChannelApi(data) {//订阅拖拽排序
    return Axios({
        url: '/cms/yaseeContentRouterDetail/addChannel/' + data.id,
        method: 'put',

    })
}


//============================================搜索页面==================================================
export function querySearchLogApi(obj) {//查询搜索历史记录
    return Axios({
        url: '/cms/yaseeContentSearch/querySearchLog',
        method: 'get',

    })
}

export function deleteSearchLogApi(obj) {//删除搜索记录
    return Axios({
        url: '/cms/yaseeContentSearch/deleteSearchLog',
        method: 'get',
    })
}


export function contentSearchApi(obj) {//资讯、文章列表
    return Axios({
        url: '/cms/yaseeContentSearch/contentSearch',
        method: 'get',
        params: obj,

    })
}

export function userSearchApi(obj) {//作者搜索记录
    return Axios({
        url: '/cms/yaseeContentSearch/userSearch',
        method: 'post',
        data: obj,

    })
}

export function addAuthorLikeApi(obj) {//资讯、文章列表
    return Axios({
        url: '/cms/yaseeAuthorLikeDetail/addAuthorLike/' + obj.id,
        method: 'get',

    })
}

// ========================================文章详情=============================================
export function queryArticleDetailApi(data) {//资讯、文章列表
    return Axios({
        url: '/cms/yaseeContent/queryArticleDetail/' + data.id,
        method: 'get',

    })
}

export function queryDynamicApi(obj) {//动态详情
    return Axios({
        url: '/cms/yaseeContent/queryDynamic',
        method: 'get',
        params: obj,

    })
}

export function queryDynamicListApi(obj) {//动态列表
    return Axios({
        url: '/cms/yaseeContent/queryDynamicList',
        method: 'get',
        params: obj,
    })
}


